package com.tvunetworks.center.user.mapper;

import com.tvunetworks.center.user.model.DeviceGeo;
import com.tvunetworks.center.user.model.param.PageDeviceGeoParam;
import com.tvunetworks.center.user.model.vo.DeviceGeoVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @program:
 * @description:
 * @author HenryChen
 * @create: 5/23/2019 1:54 PM
 **/
public interface DeviceGeoMapper extends Mapper<DeviceGeo> {
    /**
     *
     * @param peerIds peerIds
     * @return List
     */
    List<DeviceGeo> getDevicePositionByPeerIds(@Param("peerIds") List<String> peerIds);

    /**
     * support 账号分页查询结果
     * @param param param
     * @return List
     */
    List<DeviceGeoVo> supportPage(PageDeviceGeoParam param);

    /**
     *
     * @param peerId peerId
     * @return DeviceGeoVo
     */
    DeviceGeoVo getDeviceGeo(@Param("peerId") String peerId);

    /**
     * 根据rid，查询出R X peerId
     * @param rid rid
     * @return List
     */
    List<String> listRXPeerIdByRid(String rid);

    /**
     * anywhere 是否跟用户有token配对
     * @param userId userId
     * @param peerId peerId
     * @return int
     */
    int isDevicePairWithUserToken(@Param("userId") String userId, @Param("peerId") String peerId);

    /**
     * Admin、User用户根据status查询符合条件的peerIds
     * @param deviceGeoParam deviceGeoParam
     * @return List
     */
    List<String> userPagePeerIds(PageDeviceGeoParam deviceGeoParam);

    /**
     * 根据peerIds查询List<DeviceGeoVo>
     * @param peerIds peerIds
     * @return List
     */
    List<DeviceGeoVo> listDeviceGeoVoByPeerIds(@Param("peerIds") List<String> peerIds);

    /**
     * Admin、User用户根据status查询符合条件的deviceGeo
     * @param deviceGeoParam deviceGeoParam
     * @return List
     */
    List<DeviceGeoVo> userPageDeviceGeoVos(PageDeviceGeoParam deviceGeoParam);
}
